 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="title">
            <h2><a href="#" class="back" onclick="history.go(-1)"/>Cadastrar Etiqueta</h2>
        </ui:define>
        <ui:define name="body">

            <h:form id="clienteForm" enctype="multipart/form-data">            
                <p:messages id="messages" closable="true" showDetail="true" autoUpdate="true"  />
                <p> 
                    <p:panel id="dadosGeraisPanel" styleClass="container_24 clearfix">
                        <h2><a href="#">Dados Gerais</a></h2>

                        <p:outputLabel value="Protocolo:" styleClass="grid_3" for="numeroProtocoloInputText"/>
                        <p:inputMask id="numeroProtocoloInputText" styleClass="grid_8" 
                                     mask="99999/9999"
                                     value="#{managerCriarArquivo.numeroProtocolo}"/>
                        <p:watermark for="numeroProtocoloInputText" value="Ex: 00001/2014" />

                        <p:outputLabel value="Data:" styleClass="grid_3" for="dataCalendar"/>
                        <p:calendar id="dataCalendar" value="#{managerCriarArquivo.arquivo.anoArquivo}"
                                    showOn="both" locale="pt" 
                                    navigator="true" pattern="dd/MM/yyyy" styleClass="grid_9" />
                    </p:panel> 
                    <p:panel id="dadosEtiqueta" styleClass="container_24 clearfix">
                        <h2><a href="#">Etiqueta</a></h2>

                        <p:outputLabel value="Caixa:" styleClass="grid_3" for="caixaInputText"/>
                        <p:inputText id="caixaInputText" styleClass="grid_8" 
                                     value="#{managerCriarArquivo.arquivo.numCaixa}"/> 

                        <p:outputLabel value="Pratileira:" styleClass="grid_3" for="prateleiraInputText"/>
                        <p:inputText id="prateleiraInputText" styleClass="grid_8" 
                                     value="#{managerCriarArquivo.arquivo.pratileira}"/>
                        <div class="clear"/>

                        <p:outputLabel value="Estante:" styleClass="grid_3" for="estanteInputText"/>
                        <p:inputText id="estanteInputText" styleClass="grid_8" 
                                     value="#{managerCriarArquivo.arquivo.estante}"/>

                        <p:outputLabel value="Ala:" styleClass="grid_3" />
                        <div class="grid_8">
                            <p:selectOneMenu style="width: 87%"
                                             value="#{managerCriarArquivo.arquivo.ala}">
                                <f:selectItems value="#{managerCriarArquivo.tipoAla}"/>
                            </p:selectOneMenu>
                        </div>


                    </p:panel> 


                    <div class="buttonAction">
                        <p:commandButton value="Salvar" actionListener="#{managerCriarArquivo.salvar()}"
                                         icon="ui-icon-disk" styleClass="ui-priority-primary"
                                         update="@form"  />
                        <p:button value="Cancelar" icon="ui-icon-circle-close"
                                  href="indexarquivo.xhtml"
                                  />
                    </div>
                </p>
            </h:form>
            <h:form id="dlgForm">

                <p:dialog id="iddlg" header="Protocolo já arquivado!, deseja atualizar os dados " widgetVar="dlg" modal="false"
                          width="600" resizable="false" closable="false" height="70">  


                    <p:panel id="dPanel" styleClass="container_24 clearfix">

                    </p:panel>
                    <div class="buttonAction">
                        <p:commandButton value="Sim" update="@form"  process="@this"    actionListener="#{managerCriarArquivo.atualizarArquivo()}" icon="ui-icon-disk" />
                        <p:commandButton value="Não" process="@this" onclick="dlg.hide()" icon="ui-icon-close" />
                    </div>
                    <!--                    </p:panel>-->

                </p:dialog>   

            </h:form>
        </ui:define>
    </ui:composition>
</html>



